for n in range(1,1000):
    a=n//100
    b=(n-100*a)//10
    c=n-100*a-10*b
    
    if n==a*a*a+b*b*b+c*c*c:
        print(n)
